<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>响应式示例</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="../static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <script src="../static/bootstrap-3.3.7-dist/js/jquery.min3.5.js"></script>
    <script src="../static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <style>
        body {
            overflow-x: hidden;
        }
        @media screen and (max-width: 767px) {
            .r1 {
                position: relative;
                right: 0;
                transition: all .25s ease-out;
            }
            .r1 .my-sidebar {
                right: -50%;
                /*当是小屏幕的时候先把列表组移过去*/
            }
            .r1.active {
                right: 50%;
                /*当点击按钮的时候在把列表组移进来*/
            }
            .my-sidebar {
                position: absolute;
                top: 0;
                width: 50%;
            }
        }
    </style>
</head>
<body>
<!--导航条-->
<nav class="navbar navbar-inverse">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Project name</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">Home <span class="sr-only">(current)</span></a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container">
    <div class="row r1">
        <!--左侧部分-->
        <div class="col-md-9 col-sm-9" id="c1">
            <!--toggle-->
            <!--visible-xs   当屏幕是超小屏幕的时候显示-->
            <p class="pull-right visible-xs">
                <button class="btn-xs btn btn-primary" id="togglebtn">Toggle nav</button>
            </p>
            <!--巨幕-->
            <div class="bs-example" data-example-id="simple-jumbotron">
                <div class="jumbotron">
                    <h1>Hello, world!</h1>
                    <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to
                        featured content or information.</p>
                </div>
            </div>
            <!--内容-->
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
            <!--分块的内容-->
            <div class="col-md-4 col-sm-6">
                <h3>Thumbnail label</h3>
                <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at
                    eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                <p><a href="#" class="btn btn-default" role="button">查看详情>></a></p>
            </div>
        </div>

        <!--右侧部分：列表组-->
        <div class="col-sm-3  my-sidebar " id="listgroup">
            <div class="list-group">
                <a href="#" class="list-group-item active">Cras justo odio</a>
                <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
                <a href="#" class="list-group-item">Morbi leo risus</a>
                <a href="#" class="list-group-item">Porta ac consectetur ac</a>
                <a href="#" class="list-group-item">Vestibulum at eros</a>
                <a href="#" class="list-group-item">Vestibulum at eros</a>
                <a href="#" class="list-group-item">Vestibulum at eros</a>
                <a href="#" class="list-group-item">Vestibulum at eros</a>
            </div>
        </div>
    </div>
</div>
<script src="bootstrap.js"></script>
<script>
    $(document).ready(function () {
        $("#togglebtn").on("click",function () {
            $(".r1").toggleClass("active")
        })
    });

</script>
</body>
</html>